package com.example.demo4.service;

import com.example.demo4.entity.Book;
import com.example.demo4.mapper.BookMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookService {
    @Autowired
    private BookMapper bookMapper;
    public Book getBookInfo(int id){
        return bookMapper.getBookInfo(id);
    }
    public int deleteById(int id){
        return bookMapper.deleteById(id);
    }
    public int Update(Book book){
        return bookMapper.update(book);
    }
    public Book save(Book book){
        int save = bookMapper.save(book);
        return book;
    }
    public List<Book> selectAll(){
        return bookMapper.selectAll();
    }
}
